package property.personal.property_mange.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import property.personal.property_mange.pojo.ParseData;
import property.personal.property_mange.pojo.Staff;
import property.personal.property_mange.service.impl.StaffImpl;

@Controller
public class StaffController {

    @Autowired
    StaffImpl staffimpl;

    @ResponseBody
    @RequestMapping("/getstaff")
    public ParseData getstaff(@RequestParam("page") int page,@RequestParam("limit") int limit,@RequestParam(value = "searchname",required = false) String searchname){
        IPage ipage;
        ipage=staffimpl.getstaff(page,limit,searchname);
        System.out.println("1111");
        System.out.println("2222");

        return new ParseData(0,"分页成功",ipage.getTotal(),ipage.getRecords());
    }
}
